<template>
  <div align="center">
    <el-table :data="userList" border style="width: 50%" >
      <el-table-column prop="id" label="编号" width="180" align="center"> </el-table-column>
      <el-table-column prop="name" label="姓名" width="180" align="center"> </el-table-column>
      <el-table-column prop="money" label="余额" align="center"> </el-table-column>
    </el-table>
    <el-button type="primary" @click="getUser">主要按钮</el-button>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data: function () {
    return {
      userList: [],
    };
  }, 
  methods: {
    getUser() {
      this.$http.get("/user").then((response) => {
        console.log(response.data);
        this.userList = response.data;
      });
    },
  },
};
</script>

<style>

</style>
